approveMulitpleAppointmentRating
approveMulitpleAppointmentRating
This method processes the approval or rejection of multiple appointment ratings in sequence, collecting individual results for each rating.
-
Extract Input Data
- Retrieve the
agent_idand the list ofratingsfrom the input DTO.
- Retrieve the
-
Initialize Results Array
- Create an empty array to store the outcome of each rating approval/rejection.
-
Iterate Over Ratings
-
For each rating item in the input list:
-
Call the existing
approveAppointmentRatingmethod with the correspondingbooking_id,status, andagent_id. -
If the approval/rejection succeeds:
- Add a success entry to the results array, including the
booking_id, a success flag, and a success message.
- Add a success entry to the results array, including the
-
If an error occurs during approval/rejection:
- Catch the error and add a failure entry to the results array, including the
booking_id, a failure flag, and the error message.
- Catch the error and add a failure entry to the results array, including the
-
-
-
Return Consolidated Results
- Return an object containing the results array summarizing the status for each processed rating.